package com.drg.center.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.drg.center.entity.DictMdcPO;
import com.drg.center.mapper.DictMdcMapper;
import com.guaike.core.mybatis.plugins.BaseDAO;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class DictMdcDAO extends BaseDAO<DictMdcMapper, DictMdcPO> {

    public List<DictMdcPO> searchMDC(String search) {
        LambdaQueryWrapper<DictMdcPO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.like(DictMdcPO::getMdcCode, search)
                .or().like(DictMdcPO::getMdcName, search);
        queryWrapper.last("limit 0,20");
        return getBaseMapper().selectList(queryWrapper);
    }
}
